A Formally Verified SSA-Based Middle-End - Static Single Assignment Meets CompCert
نویسندگان
چکیده
CompCert is a formally verified compiler that generates compact and efficient PowerPC, ARM and x86 code for a large and realistic subset of the C language. However, CompCert foregoes using Static Single Assignment (SSA), an intermediate representation that allows for writing simpler and faster optimizers, and is used by many compilers. In fact, it has remained an open problem to verify formally a SSA-based compiler middle-end. We report on a formally verified, SSAbased, middle-end for CompCert. Our middle-end performs conversion from CompCert intermediate form to SSA form, optimization of SSA programs, including Global Value Numbering, and transforming out of SSA to intermediate form. In addition to provide the first formally verified SSA-based middle-end, we address two problems raised by Leroy [13]: giving a simple and intuitive formal semantics to SSA, and leveraging the global properties of SSA to reason locally about program optimizations.
منابع مشابه
Verifying Fast and Sparse SSA-Based Optimizations in Coq
The Static Single Assignment (SSA) form is a predominant technology in modern compilers, enabling powerful and fast program optimizations. Despite its great success in the implementation of production compilers, it is only very recently that this technique has been introduced in verified compilers. As of today, few evidence exist on that, in this context, it also allows faster and simpler optim...
متن کاملThe Advantages of Instance-Wise Reaching Definition Analyses in Array (S)SA
Several parallelizing or general-purpose compilers have been using intermediate representations based on some form of single-assignment. Extending these representations to arrays has been done in two ways: Array SA, and Array SSA, the extension of the widely-used Static Single Assignment (SSA). We formally deene and compare Array SA and Array SSA, and show that (1) They both need instance-wise ...
متن کاملA Formally-Verified Alias Analysis
This paper reports on the formalization and proof of soundness, using the Coq proof assistant, of an alias analysis: a static analysis that approximates the flow of pointer values. The alias analysis considered is of the points-to kind and is intraprocedural, flow-sensitive, field-sensitive, and untyped. Its soundness proof follows the general style of abstract interpretation. The analysis is d...
متن کاملCompiler verification for fun and profit
OF INVITED TALK Formal verification of software or hardware systems — be it by model checking, deductive verification, abstract interpretation, type checking, or any other kind of static analysis — is generally conducted over high-level programming or description languages, quite remote from the actual machine code and circuits that execute in the system. To bridge this particular gap, we all r...
متن کاملCompCertS: A Memory-Aware Verified C Compiler Using Pointer as Integer Semantics
The CompCert C compiler provides the formal guarantee that the observable behaviour of the compiled code improves on the observable behaviour of the source code. In this paper, we present a formally verified C compiler, CompCertS, which is essentially the CompCert compiler, albeit with a stronger formal guarantee: it gives a semantics to more programs and ensures that the memory consumption is ...
متن کامل